Skip to content

Conversation

@lazardanlucian
Copy link
Contributor

We have some cases where our pages in wp-admin don't work.

Fatal error: Uncaught Error: trim(): Argument #1 ($string) must be of type string, null given in /var/www/wp-content/mu-plugins/query-monitor/collectors/raw_request.php on line 73

Fatal error: Uncaught Error: trim(): Argument #1 ($string) must be of type string, null given
in /var/www/wp-content/mu-plugins/query-monitor/collectors/raw_request.php on line 73
@johnbillion
Copy link
Owner

johnbillion commented Oct 25, 2023

Thanks for the PR. It sounds like your server is outputting an HTTP header in an unexpected format. Can you provide a list of the headers in the response so we can see what's up?

@lazardanlucian
Copy link
Contributor Author

Hello, I found the issue.
There was a header set without a value, from a php snippets plugin.

This still could be useful here, since a header without a value will not break anything, why have it break qm

@lazardanlucian
Copy link
Contributor Author

array (size=3)
0 => string 'X-Powered-By: PHP/8.0.27' (length=24)
1 => string 'Sample-Header-No-Value' (length=22)
2 => string 'Test: Value' (length=11)

this will break QM and wp-admin pages where Sample header exists

@lazardanlucian
Copy link
Contributor Author

lazardanlucian commented Oct 25, 2023

@johnbillion Although the RFC mandate a header value, I'm not sure if the application should break if there is a header without a value.

So our problem is fixed by fixing the header, so it's up to you how you want to treat this 🤖

@johnbillion
Copy link
Owner

Thanks, I'll make some adjustments to the header handling to handle this.

@johnbillion johnbillion added this to the 3.20.0 milestone Aug 24, 2025
@johnbillion johnbillion merged commit a6994ee into johnbillion:develop Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants